﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
using System.Threading;
using System.ComponentModel;

namespace IM.gerenciadores
{
    public class GerenciadorDeAtencao
    {
        public static void moveTela(Form form)
        {
            form.TopLevel = true;
            form.Enabled = false;
            int posX = form.Location.X;
            int posY = form.Location.Y;
            int tempoThread = 50;
            int qtdeLoop = 2;

            for (int i = 0; i < qtdeLoop; i++)
            {
                form.Location = new Point(posX - 3, posY + 3);
                Thread.Sleep(tempoThread);
                form.Location = new Point(posX + 3, posY + 3);
                Thread.Sleep(tempoThread);
                form.Location = new Point(posX - 3, posY + 3);
                Thread.Sleep(tempoThread);
                form.Location = new Point(posX - 3, posY - 3);
                Thread.Sleep(tempoThread);
            }
            form.Location = new Point(posX, posY);
            form.Enabled = true;
        }

        public static void moveTelaMaximizada(Form form)
        {
            form.TopLevel = true;
            form.Enabled = false;
            int tempoThread = 50;
            int qtdeLoop = 2;
            for (int i = 0; i < qtdeLoop; i++)
            {
                form.WindowState = FormWindowState.Normal;
                Thread.Sleep(tempoThread);
                form.WindowState = FormWindowState.Maximized;
                Thread.Sleep(tempoThread);
            }
            form.Enabled = true;
        }
    }
}
